package com.lijin.study.java.bean;

import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;

public class ReadBeanInfo {

	public static void main(String[] args) throws IntrospectionException {
		BeanInfo bi = Introspector.getBeanInfo(TestBean.class);
		System.out.println(bi);
		PropertyDescriptor[] pds = bi.getPropertyDescriptors();
		
		for (PropertyDescriptor pd : pds) {
			System.out.println(pd.getDisplayName());
			System.out.println(pd.getName());
			System.out.println(pd.getShortDescription());
			System.out.println(pd.getReadMethod());
			System.out.println(pd.getClass());
			System.out.println(pd.getPropertyType());
			System.out.println(pd.getWriteMethod());
			
			System.out.println("---------------");
		}
	}
}
